package com.net.xpay.common.dao.partner;

import com.net.xpay.common.domain.partner.PartnerCombinationSettleRecord;
import com.net.xpay.common.enums.partner.PartnerCombinationSettleRecordType;
import com.net.common.dao.Page;
import com.net.common.dao.PagedMapper;
import com.net.common.annotation.DataCommon;
import com.net.xpay.core.model.PartnerCombinationSettleRecordAggSearchModel;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

@DataCommon
@Repository
public interface PartnerCombinationSettleRecordMapper extends PagedMapper<Long, PartnerCombinationSettleRecord> {
    int updateSettleInfo(@Param("partnerId") Long partnerId, @Param("type") PartnerCombinationSettleRecordType type, @Param("startDay") LocalDate startDay, @Param("endDay") LocalDate endDay, @Param("settleTime") LocalDateTime settleTime);

    List<PartnerCombinationSettleRecord> aggSearch(@Param("searchModel") PartnerCombinationSettleRecordAggSearchModel searchModel, @Param("page") Page page);

    long aggSearchCount(@Param("searchModel") PartnerCombinationSettleRecordAggSearchModel searchModel);

    List<PartnerCombinationSettleRecord> aggSumUserMonthData(@Param("userId") Long userId, @Param("endDay") LocalDate endDay);

    List<PartnerCombinationSettleRecord> partnerAggSearch(@Param("searchModel") PartnerCombinationSettleRecordAggSearchModel searchModel, @Param("page") Page page);

    long partnerAggSearchCount(@Param("searchModel") PartnerCombinationSettleRecordAggSearchModel searchModel);

    List<PartnerCombinationSettleRecord> aggList(@Param("searchModel") PartnerCombinationSettleRecordAggSearchModel searchModel);
}
